<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
      layout:decorator="share/adminPop">

<div layout:fragment="content">
    <form id="data_save" class="form form-horizontal"> <!--enctype="multipart/form-data"-->
        <input type="hidden" name="id" th:value="${m.id == null ? null : T(java.util.Base64).getEncoder().encodeToString(m.id)}" />
        <input type="hidden" name="postState" th:value="${m.postState}" />
        <input type="hidden" name="generalFormat" th:value="${m.generalFormat}" />
        <input type="hidden" name="fileSize" th:value="${m.fileSize}" />
        <input type="hidden" name="overallBitRate" th:value="${m.overallBitRate}" />
        <input type="hidden" name="format" th:value="${m.format}" />
        <input type="hidden" name="bitRate" th:value="${m.bitRate}" />
        <input type="hidden" name="width" th:value="${m.width}" />
        <input type="hidden" name="height" th:value="${m.height}" />
        <input type="hidden" name="scanType" th:value="${m.scanType}" />
        <input type="hidden" name="frames" th:value="${m.frames}" />
        <input type="hidden" name="fps" th:value="${m.fps}" />

        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>名称：</label>
            <div class="formControls col-9">
                <input type="text" class="input-text" th:value="${m.name}"  name="name">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>标准名：</label>
            <div class="formControls col-9">
                <input type="text" class="input-text" th:value="${m.nameStd}"  name="nameStd">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>科目名：</label>
            <div class="formControls col-9">
                <input type="text" class="input-text" th:value="${m.subject}"  name="subject">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3">分类：</label>
            <div class="formControls col-6">
                <select class="select select-box inline selCate" name="cateId" onchange="basicData.selCateChange(this)">
                    <option value="0" path="/0">--请选择</option>
                </select>
                <input type="hidden" id="cateName" name="cateName" th:value="${m.cateName}"/>
                <input type="hidden" id="catePath" name="catePath" th:value="${m.catePath}"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>设备Id：</label>
            <div class="formControls col-9">
                <input type="text" class="input-text" th:value="${m.deviceId}"  name="deviceId">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>持续时间(视频)：</label>
            <div class="formControls col-9">
                <input type="text" class="input-text" th:value="${m.generalDuration}"  name="generalDuration">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>设持续时间(概况):</label>
            <div class="formControls col-9">
                <input type="text" class="input-text" th:value="${m.duration}"  name="duration">
            </div>
        </div>
        <div class="row cl">
            <div class="col-9 col-offset-2">
                <input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;&nbsp;&nbsp;
                <button onclick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>

        </div>
            <!--<input type="hidden" id="scrollTop" name="scrollTop" />-->
    </form>
</div>
<script type="text/javascript" layout:fragment="scripts" th:inline="javascript">
     basicData.getCateTree(".selCate", '[[${m.cateId}]]');

    $('.btn-primary').click(function () {
       $lv.actionJson('/admin/video/save', function (r) {
           if (r.code) {
               $lv.toast('成功！');
               //alert(parent.tb);
               parent.tb.fnDraw();
               layer_close();

           } else $lv.toast('no');
       }, 'data_save');
    });
</script>